﻿using System.Collections.Generic;
using System.Threading.Tasks;

namespace Xc.DataAccess.Core
{
    /// <summary>
    /// 设备工厂服务
    /// </summary>
    /// <typeparam name="TService"></typeparam>
    /// <typeparam name="TOption"></typeparam>
    public interface IDevcieFactoryService<TService, TOption>
        where TService : IDeviceService<TOption>
        where TOption : class, IDevcieId
    {
        /// <summary>
        /// 获取功能列表
        /// </summary>
        /// <returns></returns>
        string[] GetFunctions();
        /// <summary>
        /// 获取服务
        /// </summary>
        /// <param name="devcieId"></param>
        /// <returns></returns>
        TService GetService(IDevcieId devcieId);
        /// <summary>
        /// 获取服务
        /// </summary>
        /// <param name="serviceIndex"></param>
        /// <returns></returns>
        TService GetService(int serviceIndex);
        /// <summary>
        /// 获取服务
        /// </summary>
        /// <param name="functionName"></param>
        /// <returns></returns>
        TService GetService(string functionName);
        /// <summary>
        /// 获取服务列表
        /// </summary>
        /// <returns></returns>
        int[] GetServiceIndexs();
        /// <summary>
        /// 设置服务
        /// </summary>
        /// <param name="options"></param>
        /// <returns></returns>
        Task<ResultData<TOption, TService>[]> SetServiceAsync(params TOption[]  options);
    }
}